<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ include file="/sks/cms/page/share/taglib.jsp"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<%
	String path = request.getContextPath();
	String basePath = request.getScheme() + "://"
			+ request.getServerName() + ":" + request.getServerPort()
			+ path + "/";
	int buildNum = request.getAttribute("buildNum") == null ? 0: Integer.parseInt(request.getAttribute("buildNum").toString());	
	
	int houseNum = request.getAttribute("houseNum") == null ? 0: Integer.parseInt(request.getAttribute("houseNum").toString());

%>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="keywords" content="租房,买房,三棵松,地产,中介" />
<meta name="description" content="三棵松地产" />
<title>三棵松地产</title>
<%-- <link rel="stylesheet" type="text/css" media="screen" href="<%=basePath %>sks/css/frontpages/BrightSide.css" /> --%>
<link rel="stylesheet" type="text/css" media="screen"
	href="<%=basePath%>sks/css/frontpages/mytestcss.css" />
<link rel="stylesheet" type="text/css" media="screen"
	href="<%=basePath%>sks/css/frontpages/deployment.css" />
<link rel="stylesheet" type="text/css" media="screen"
	href="<%=basePath%>sks/css/frontpages/deploy.css" />
<script type="text/javascript">
function bodyOnLoad() {
	<%
	String errorMsg = (String) request.getAttribute("errorMsg");
	if (!StringUtil.isEmpty(errorMsg)) {
		out.print("alert('" + errorMsg + "')");
	}
	%>
}
function changeHouseStatus(status) {
	window.location.href = '<%=basePath%>'+'sks/frontpages/privilege/deployment/manage.do?method=changeStatus&houseStatus=' + status;
}

//删除房源确认框
function deleteConfirm() {
	if (confirm("是否确认删除房源?")) {
		return true;
	} else {
		return false;
	}
}

//提交房源确认框
function submitConfirm() {
	if (confirm("是否确认提交房源?")) {
		return true;
	} else {
		return false;
	}
}

//撤销提交的房源
function nonsubmitConfirm() {
	if (confirm("是否确认撤销房源?")) {
		return true;
	} else {
		return false;
	}
}
</script>
</head>
<body onload="bodyOnLoad();">
	<div class="wrap">
		<jsp:include page="../../header.jsp"></jsp:include>
		<div>
			<div>
				<a href="<%=basePath%>" hidefocus="true">SKS房地产</a>&nbsp;&gt;&nbsp;个人中心
			</div>
			<div class="clear"></div>
		</div>
		<!-- content-wrap starts here -->
		<div class="w main">

			<div class="club_main">
				<div id="container" class="col_1">
					<div class="columnright col_l" id="Zone1">
						<span class="dragLayer" id="M028,M028,M028,Single" cdrag="row"><a name="M028_1"></a>
							<span class="dragHeader" cdrag="title">
								<div class="main_righttitle50_left">我的收藏</div>								
								<div class="clear"></div>
							</span>
							<div class="main_leftbox">
								<div id="itemContent_M028">
									<table width="100%">
										<tbody>
											<tr><td colspan="2">
												小区收藏
												共：<b>${buildNum }</b>个
											</td></tr>
												<c:forEach var="p" items="${pv.records}" varStatus="index">
													<tr><td valign="top" width="25px">${index.count}.&nbsp;</td>
													<td>
													<a href="<html:rewrite action="sks/districtInfo" />?method=base&menuName=village&buildingId=${p.building.buildingId}" >
													${p.buildingName }
													</a>
													</td></tr>
												</c:forEach>
										</tbody>
									</table>
									<br>
									<table width="100%">
										<tbody>
											<tr><td colspan="2">
												房源收藏
												共：<b>${houseNum }</b>个
												</td>
											</tr>
											<c:forEach var="h" items="${page.records}" varStatus="index">
												<tr><td valign="top" width="25px">${index.count}.&nbsp;</td>
												<td>
												<a href="<html:rewrite action="/sks/house" />?method=info&houseId=${h.house.houseId}" >
												${h.houseName }
												</a>
												</td></tr>
											</c:forEach>
										</tbody>
									</table>
								</div>
							</div> </span>
					</div>
					<div class="column col_l" id="Zone2">
						<span class="dragLayer" id="M301,M301,M301,Single" cdrag="row"><a name="M301_1"></a>
							<span class="dragHeader" cdrag="title">
									<div class="main_righttitle50_left">个人中心</div>
									<div class="clear"></div>
							</span>
							<div class="main_leftbox">
								<div id="itemContent_M301">
										<li><a
											href="/sks/frontpages/privilege/deployment/manage.do?method=addUI"
											title="添加房源" target="_self">添加房源</a></li>
										<li><a href="/sks/privilege/user/reg.do?method=editUsersUI" onclick="">编辑个人信息</a></li>
										<li><a href="/sks/message.do?method=addUI" onclick="">委托找房</a></li>
										<li><a href="<%=basePath %>sks/frontpages/privilege/deployment/changePassword.jsp" onclick="">修改密码</a></li>
								</div>
							</div> 
					</div>
					<div class="column col_m" id="Zone3">
						<span class="dragLayer1" id="M009,M009,SQLLIST,Folder" cdrag="row"><a name="M009_1"></a>
							<span class="dragHeader" cdrag="title">
									<div class="main_righttitle50_left">房源</div>
									<div class="clear"></div>
							</span>
							<div class="main_nav">
								<div class="clear"></div>
							
							<div class="main_rightbox">
								<div id="itemContent_M009">
										<table width="100%" cellspacing="0" class="club01_tab">
											<tbody>
												<tr class="club01_tab_title">
													<td width="20%">创建时间</td>
													<td width="40%">房源名称</td>
													<td width="10%">房型</td>
													<td width="15%">操作</td>
													<td width="10%">房源状态</td>
												</tr>
												<c:forEach items="${pageView.records}" var="entry">
													<tr>
														<td>
														<fmt:formatDate value='${entry.createTime}' pattern='yyyy-MM-dd HH:mm' />
														</td>
														<td title="${entry.title}" class="table01_l"><span class="c_gray6">
															<a href="<html:rewrite action="/sks/frontpages/privilege/deployment/manage" />?method=editDeploymentUI&houseId=${entry.houseId}">
															${entry.title}
															</a>
														</span></td>
														<td title="houseType" class="table01_l" align="center"><span
															class="c_gray6"> ${entry.houseType.name}</a>
														</span></td>
														<td align="center">
														
														<c:if test="${entry.houseStatus == 'noneSubmit'}">
															<a onclick="return deleteConfirm();" href="<html:rewrite action="/sks/frontpages/privilege/deployment/manage" />?method=delete&houseId=${entry.houseId}">
																删除</a>&nbsp;&nbsp;
															<a onclick="return submitConfirm();" href="<html:rewrite action="/sks/frontpages/privilege/deployment/manage" />?method=changeStatus&houseStatus=noneAudit&houseId=${entry.houseId}">提交</a>&nbsp;&nbsp;
														</c:if> <c:if test="${entry.houseStatus == 'noneAudit'}">
															<a onclick="return nonsubmitConfirm();" href="<html:rewrite action="/sks/frontpages/privilege/deployment/manage" />?method=changeStatus&houseStatus=noneSubmit&houseId=${entry.houseId}">撤销</a>
														</c:if>
														
														</td>
														<td align="center"><c:if
																test="${entry.houseStatus == 'noneSubmit'}">
																<span class="c_gre_light">未提交</span>
															</c:if> <c:if test="${entry.houseStatus == 'noneAudit'}">
																<span class="c_gre_light">未审核</span>
															</c:if> <c:if test="${entry.houseStatus == 'audited'}">
																<span class="c_gre_light">已审核待发布</span>
															</c:if> <c:if test="${entry.houseStatus == 'published'}">
																<span class="c_gre_light">已发布</span>
															</c:if> <c:if test="${entry.houseStatus == 'finished'}">
																<span class="c_gre_light">已完成交易</span>
															</c:if> <c:if test="${entry.houseStatus == 'invalidate'}">
																<span class="c_gre_light">失效</span>
															</c:if></td>
													</tr>
												</c:forEach>
											</tbody>
										</table>
								</div>

							</div></div> </span>
					</div>
				</div>
				<div style="display: none"></div>
			</div>
		</div>
		<jsp:include page="../../rooster.jsp"></jsp:include>
	</div>
</body>

</html>
